package vista;

import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VDetallePoliza extends javax.swing.JFrame {
	private JPanel panDetallePoliza;
	private JButton btnCancelarDetallePoliza;
	private JButton btnSalirDetallePoliza;
	private JButton btnAgregar;
	private JTextField txtMontoCaract;
	private JLabel lblMontoCaract;
	private JComboBox cmbDescripCaract;
	private JLabel lblDescripcionCaracte;
	private JSeparator spnTituloInfDetallePoliza;
	private JLabel lblInfDetallePoliza;
	private JLabel lblCodDetalle;
	private JTextField txtCodDetalle;
	private JTextField txtCodPoliza;
	private JLabel lblCodPoliza;

	public VDetallePoliza(String codigo) {
		super();
		initGUI();
		this.txtCodPoliza.setText(codigo);
		this.txtCodPoliza.setEditable(false);
	}
	
	private void initGUI() {
		try {
			AnchorLayout thisLayout = new AnchorLayout();
			getContentPane().setLayout(thisLayout);
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				panDetallePoliza = new JPanel();
				panDetallePoliza.setLayout(null);
				getContentPane().add(panDetallePoliza, new AnchorConstraint(1, 1000, 1001, 0, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				panDetallePoliza.setPreferredSize(new java.awt.Dimension(608, 308));
				panDetallePoliza.setBackground(new java.awt.Color(14,98,181));
				{
					lblInfDetallePoliza = new JLabel();
					panDetallePoliza.add(lblInfDetallePoliza, new AnchorConstraint(17, 634, 66, 365, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
					lblInfDetallePoliza.setText("Información Detalle Poliza");
					lblInfDetallePoliza.setBounds(153, 7, 312, 15);
					lblInfDetallePoliza.setFont(new java.awt.Font("Andika Basic",1,18));
				}
				{
					spnTituloInfDetallePoliza = new JSeparator();
					panDetallePoliza.add(spnTituloInfDetallePoliza);
					spnTituloInfDetallePoliza.setBounds(43, 34, 471, 10);
				}
				{
					lblDescripcionCaracte = new JLabel();
					panDetallePoliza.add(lblDescripcionCaracte);
					lblDescripcionCaracte.setText("Descripción Característica:");
					lblDescripcionCaracte.setBounds(80, 166, 197, 22);
					lblDescripcionCaracte.setFont(new java.awt.Font("Andika Basic",0,14));
				}
				{
					ComboBoxModel cmbDescripCaractModel = 
							new DefaultComboBoxModel(
									new String[] { "Colisión y/o volcadura", "Rotura de cristales por accidente", "Robo e incendio", "Asistencia de viaje", "Lesión o muerte a personas", "Responsabilidad de pasajeros", "Daños a la propiedad ajena", "Fianza Judicial", "Gastos médicos", "Accidentes personales al conductor", "Accidentes personales a peatones", "Servicio de grúa", "Alquiler gratis de automóvil" });
					cmbDescripCaract = new JComboBox();
					panDetallePoliza.add(cmbDescripCaract);
					cmbDescripCaract.setModel(cmbDescripCaractModel);
					cmbDescripCaract.setBounds(295, 157, 202, 41);
				}
				{
					lblMontoCaract = new JLabel();
					panDetallePoliza.add(lblMontoCaract);
					lblMontoCaract.setText("Monto Característica");
					lblMontoCaract.setBounds(78, 213, 172, 22);
					lblMontoCaract.setFont(new java.awt.Font("Andika Basic",0,14));
				}
				{
					txtMontoCaract = new JTextField();
					panDetallePoliza.add(txtMontoCaract);
					txtMontoCaract.setBounds(295, 209, 97, 31);
				}
				{
					btnAgregar = new JButton();
					panDetallePoliza.add(btnAgregar);
					btnAgregar.setText("Agregar");
					btnAgregar.setBounds(66, 279, 98, 43);
					btnAgregar.setBackground(new java.awt.Color(173,216,230));
				}
				{
					btnCancelarDetallePoliza = new JButton();
					panDetallePoliza.add(btnCancelarDetallePoliza);
					btnCancelarDetallePoliza.setText("Cancelar");
					btnCancelarDetallePoliza.setBounds(227, 279, 97, 43);
					btnCancelarDetallePoliza.setBackground(new java.awt.Color(173,216,230));
				}
				{
					btnSalirDetallePoliza = new JButton();
					panDetallePoliza.add(btnSalirDetallePoliza);
					btnSalirDetallePoliza.setText("Salir");
					btnSalirDetallePoliza.setBounds(394, 279, 96, 43);
					btnSalirDetallePoliza.setBackground(new java.awt.Color(173,216,230));
				}
				{
					lblCodPoliza = new JLabel();
					panDetallePoliza.add(lblCodPoliza);
					lblCodPoliza.setText("Codigo de la Poliza:");
					lblCodPoliza.setBounds(80, 74, 178, 15);
					lblCodPoliza.setFont(new java.awt.Font("Andika Basic",0,14));
				}
				{
					txtCodPoliza = new JTextField();
					panDetallePoliza.add(txtCodPoliza);
					txtCodPoliza.setBounds(295, 66, 97, 31);
				}
				{
					txtCodDetalle = new JTextField();
					panDetallePoliza.add(txtCodDetalle);
					txtCodDetalle.setText("");
					txtCodDetalle.setBounds(295, 112, 97, 31);
				}
				{
					lblCodDetalle = new JLabel();
					panDetallePoliza.add(lblCodDetalle);
					lblCodDetalle.setText("Codigo del Detalle:");
					lblCodDetalle.setFont(new java.awt.Font("Andika Basic",0,14));
					lblCodDetalle.setBounds(80, 120, 178, 15);
				}
			}
			pack();
			this.setSize(569, 380);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public void addListener(ActionListener action) {
		this.btnAgregar.addActionListener(action);
		this.btnCancelarDetallePoliza.addActionListener(action);
		this.btnSalirDetallePoliza.addActionListener(action);
		
	}

	public void limpiar() {
		this.txtMontoCaract.setText("");
		this.cmbDescripCaract.setSelectedIndex(0);
		
	}

}
